//
//  VideoPlayerCell.m
//  Shengzhuli
//
//  Created by FXGuo on 2018/3/16.
//  Copyright © 2018年 kamangkeji. All rights reserved.
//

#import "VideoPlayerCell.h"
#import "PlayBottomToolBar.h"

@interface VideoPlayerCell()

@property (strong, nonatomic) PlayBottomToolBar *toolBar;
@property (nonatomic,strong) UIImageView *img;

@end

@implementation VideoPlayerCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        UIImageView *img = [[UIImageView alloc]init];
        [self.contentView addSubview:img];
        self.img = img;
        
        self.toolBar = [[PlayBottomToolBar alloc]init];
        [self.toolBar.playButton addTarget:self action:@selector(playAction) forControlEvents:UIControlEventTouchUpInside];
//        self.toolBar.alpha = 1.0;
        [self.contentView addSubview:self.toolBar];
        
    }
    return self;
}
- (void)setModel:(ClubModel *)model
{
    _model = model;
    [self.img sd_setImageWithURL:[NSURL URLWithString:model.clubLogo] placeholderImage:GetImage(@"default_goods_image")];
}
- (void)playAction
{
    if ([self.delegate respondsToSelector:@selector(cl_tableViewCellPlayVideoWithCell:)]) {
        [self.delegate cl_tableViewCellPlayVideoWithCell:self];
    }
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.toolBar.frame = CGRectMake(10, self.height-35-10, self.width-20, 35);
    self.img.frame = CGRectMake(10, 10, self.width-20, self.height-20);
}

@end
